<?php $this->load->view('global_header'); ?>
<link rel="stylesheet" type="text/css" href="/assets/css/question.css"/>

<?php echo anchor(base_url().'admin.php?c=question&m=create', '添加问题'); ?>

<?php foreach ($questions as $q): ?>
    <div class="question entry">
        <div class="question_content">
            <h5><?php echo $q->author; ?></h5><div class="author">：<?php echo $q->title; ?></div>
            <p><?php echo $q->content; ?></p>
        </div>
        <div class="anwsers">
        <?php foreach ($this->question->q_anwsers($q->id) as $a): ?>
                <div class="anwser entry">
                    <h5><?php echo $a->author; ?></h5>解答：
                    <p><?php echo $a->content; ?></p>
                    <div class="footer">
                        <div class="time"><?php echo $a->created_at; ?></div>
                        <div class="actions">
        <?php echo anchor(base_url().'admin.php?c=anwser&m=edit&id=' . $a->id, '编辑'); ?>
        <?php echo anchor(base_url().'admin.php?c=anwser&m=delete&id=' . $a->id, '删除'); ?>
                        </div>
            </div>
        </div>
<?php endforeach; ?>
        </div>

        <div class="footer">
            <div class="ip">IP:<?php echo $q->ip; ?></div>
            <div class="time"><?php echo $q->created_at; ?></div>
            <div class="actions">
			<?php echo anchor(base_url().'admin.php?c=question&m=edit&id=' . $q->id, '编辑'); ?>
			<?php echo anchor(base_url().'admin.php?c=question&m=reply&id=' . $q->id, '回复'); ?>
			<?php echo anchor(base_url().'admin.php?c=question&m=delete&id=' . $q->id, '删除'); ?>
        </div>
    </div>
</div>

<?php endforeach; ?>


                <div class="page_links">
    <?php echo $page_links; ?>
            </div>

<?php $this->load->view('global_footer'); ?>